<template>
    <div id="productcart" style="width: 100%; height: 260px;"></div>
</template>

<script setup>
import * as echarts from 'echarts';
import { onMounted } from 'vue'

onMounted(() => { 
    initcart()
})
const initcart = () => { 
    const myChart = echarts.init(document.getElementById('productcart'))
    const option = {
        title: {
            text: '汽车的库存量',
            subtext: '实时数据展示',
            left: 'center'
        },
        tooltip: {
            trigger: 'item'
        },
        legend: {
            orient: 'vertical',
            left: 'left'
        },
        series: [
            {
                name: 'Access From',
                type: 'pie',
                radius: '48%',
                data: [
                    { value: 1048, name: '宝马320' },
                    { value: 735, name: '奔驰EQs' },
                    { value: 580, name: 'BYD 秦L' },
                    { value: 484, name: 'AUDI U1' },
                    { value: 300, name: 'PRSC' }
                ],
                emphasis: {
                    itemStyle: {
                        shadowBlur: 10,
                        shadowOffsetX: 0,
                        shadowColor: 'rgba(0, 0, 0, 0.5)'
                    }
                }
            }
        ]
    };
    myChart.setOption(option);
}

</script>

<style  scoped>

</style>